package com.zhtx.debt.customer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.ConfigurableEnvironment;

import java.net.InetAddress;
import java.net.UnknownHostException;

@Slf4j
@SpringBootApplication
public class CustomerApplication {

    public static void main(String[] args) throws UnknownHostException {
        ConfigurableEnvironment env = SpringApplication.run(CustomerApplication.class, args).getEnvironment();
        String port = env.getProperty("server.port", "9021");

        log.info("Access URLs:\n----------------------------------------------------------\n\t"
                        + "convert: \thttp://{}:{}/index.html\n\t"
                        + "\n----------------------------------------------------------",
                InetAddress.getLocalHost().getHostAddress(),
                port
        );
    }

}
